#include "mainwindow.h"
#include <QApplication>

#include <QtDBus>

void DeviceManager::slotInterface(QString str)
{
    qDebug() << "D-Bus Interface(com.asianux.btagent2.interface):" << str;
}


int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

       QDBusConnection bus = QDBusConnection::sessionBus();
       if(!bus.registerService("com.asianux.btagent2"))
       {//com.asianux.btagent
           qDebug() << bus.lastError().message() << "11111";
           exit(1);
       }
       DeviceManager *deviceManager = new DeviceManager();
       bus.registerObject("/", deviceManager, QDBusConnection::ExportAllSlots);

    MainWindow w;
    w.show();

    return a.exec();
}
